from scrpit.test_yun_login import YunLoginTest
import unittest,datetime
from tools.HTMLTestRunner import HTMLTestRunner
from app import BSEE_DIR
from scrpit.test_ihrm_user import IhrmUserAll

#3.加载case到套件里
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(YunLoginTest))
suite.addTest(unittest.makeSuite(IhrmUserAll))




#时间类型的数据。type=datetime.datetime
data_time = datetime.datetime.now()
str_datatime = datetime.datetime.strftime(data_time,"%Y%m%d%H%M%S")

report_path =BSEE_DIR+ "/report/yun_login_test--%s.html" % str_datatime

#执行套件，生成测试报告
#打开一个文件，来写入测试用例
f = open(report_path,"wb")

#指定HTMLTestRuner的参数
runner = HTMLTestRunner(stream=f, title="yun系统登录接口报告",description="Chrome 浏览器")
#执行并生成报告
runner.run(suite)